<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
import { mapMutations } from 'vuex';

export default {
  name: 'App',
  created() {
    addEventListener('load', (e) => {
      this.setDeviceWidth(e.currentTarget.innerWidth)
    })
    addEventListener('resize', (e) => {
      this.setDeviceWidth(e.currentTarget.innerWidth)
    })
  },
  methods: {
    ...mapMutations({
      setDeviceWidth: 'app/DEVICCE_WIDTH'
    })
  }
}
</script>
<style>
</style>